<template>
  <div>
<!--    <fullscreenModal :modal="fullscreenModal" defaultBgColor="#eee" :isAdd="false" label="楼宇" :isShowEdit="true"   @handleEdit="handleEdit" editType="detail"  @handleClose="fullscreenModal = false">-->
      <div class="detailCon">
        <div class="basicBox">
          <div class="top">
            <div class="tit">
              <b>
                {{dataInfo.louysbxx.SBMC}}
              </b>
            </div>
            <div class="row">
              <b>
                {{dataInfo.louysbxx.SWID}}
              </b>
            </div>
          </div>
          <div class="middle">
            <p>
              <label>设备型号</label>
              <span>{{ dataInfo.louysbxx.SBXH }}</span>
            </p>
            <p>
              <label>设备编号</label>
              <span>{{ dataInfo.louysbxx.SBBH }}</span>
            </p>
            <p>
              <label>资产原值</label>
              <span>{{ dataInfo.louysbxx.ZCYZ }}(元)</span>
            </p>
            <p>
              <label>设备大类</label>
              <span>{{ dataInfo.louysbxx.SBDL }}</span>
            </p>
            <p>
              <label>设备小类</label>
              <span>{{ dataInfo.louysbxx.SBXL }}</span>
            </p>
            <p>
              <label>所属楼宇</label>
              <span>{{ dataInfo.louysbxx.LOUYMC }}</span>
            </p>
            <p>
              <label>生产厂家</label>
              <span>{{ dataInfo.louysbxx.SCCJ }}</span>
            </p>
            <p>
              <label>生产时间</label>
              <span>{{ dataInfo.louysbxx.CCSJ }}</span>
            </p>
            <p>
              <label>设计年限</label>
              <span>{{ dataInfo.louysbxx.SHIYNX }}(年)</span>
            </p>
            <p>
              <label>采购批次</label>
              <span>{{ dataInfo.louysbxx.BATCH1 }}</span>
            </p>
            <p>
              <label>运行状态</label>
              <span>{{ dataInfo.louysbxx.ZHUANGT}}</span>
            </p>
            <p>
              <label>投运时间</label>
              <span>{{ dataInfo.louysbxx.TYRQ}}</span>
            </p>
          </div>
        </div>
      </div>
  </div>
</template>

<script>
import { getLbByType, getLouyByUser, getLouysbQuanxst } from '@api/srvAssurance/assetLabel/assetLabel'

export default {
  data() {
    return {
      fullscreenModal: false,
      dataInfo: {
        louysbxx: {},
        getcaigpcMap: {},
        feisxmList: [],
      },
      data: {
        defaultData: {
          dlDataList: [], //大类数据
          xlDataList: [], //小类数据
          lyDataList: [], //楼宇数据
        },
        filterData: {
          dlDataList: [], //大类数据
          xlDataList: [], //小类数据
          lyDataList: [], //楼宇数据
        },
      },
    };
  },

  methods: {
    isShowEdit (item) {
      this.$router.push({
        path: '/asset/officeMaterialRegisterEdit',
        query: {
          id: item.id,
        },
      })
    },
    getSearch(params) {
      this.initData(params);
      this.initLbType();
      this.initLyData();
    },
    //类别信息
    async initLbType() {
      let lbDatas = await getLbByType({type: "0"});
      if (lbDatas.status == 0) {
        var dataList = lbDatas.data;
        dataList.forEach(item => {
          if (item.parentCode == '') {
            this.data.defaultData.dlDataList.push(item);
          } else {
            this.data.defaultData.xlDataList.push(item);
          }
        });
      }
    },
    //楼宇信息
    async initLyData() {
      let louYuDatas = await getLouyByUser(
        {corpid: sessionStorage.getItem('corpId'),}
      );
      if (louYuDatas.status == 0) {
        var dataList = louYuDatas.data;
        dataList.forEach(item => {
          item.name = item.fangcname;
          this.data.defaultData.lyDataList.push(item);
        });
      }
    },
    //楼宇设备详细信息
    async initData(id) {
      this.fullscreenModal = true;
      let resData = await getLouysbQuanxst({ id: id });
      this.dataInfo = {};
      if (resData.status === 0) {
        this.dataInfo = resData.data;
      }
    },
    handleEdit(){
      this.$router.push({
        path: '/asset/assetHouseEquipmentEdit?id='+this.$router.history.current.query.id,
        query: {
          id: this.$router.history.current.query.id,
          fullscreenModal: false,
        },
      })
    }
  }
};
</script>

<style scoped lang="less">
  .detailCon {
    padding: 12px;
    box-sizing: border-box;
  }
  .basicBox {
    padding: 15px 10px 10px;
    box-sizing: border-box;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    position: relative;
    .top {
      border-bottom: 1px dashed #aaa;
      padding: 0 5px 10px;
      margin-bottom: 12px;
      position: relative;
      line-height: 22px;
      .tit {
        b {
          font-size: 16px;
          span {
            font-size: 14px;
          }
        }
        .type {
          background: #f2a84e;
          font-size: 9px;
          color: #fff;
          margin-left: 8px;
          padding: 2px 3px;
          border-radius: 3px;
        }
      }
      .row {
        color: #999;
        font-size: 13px;
      }
      .qrcode {
        position: absolute;
        top: 0;
        right: 0;
        img {
          width: 35px;
          height: 35px;
          margin-right: 10px;
        }
      }
    }
    .middle {
      padding: 0 5px 10px;
      box-sizing: border-box;
      //border-bottom: 1px dashed #aaa;
    }
    p {
      display: flex;
      line-height: 28px;
      label {
        width: 75px;
        color: #999;
      }
      span {
        color: #333;
        flex: 1;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }
    .bottom {
      padding: 0 5px;
      box-sizing: border-box;
      margin-top: 10px;
      p span,
      p label {
        color: #999;
      }
    }
  }
</style>
